//
//  NSString+SSPath.m
//
//  Created by Esther on 2016/12/10.
//  Copyright © 2016年 Esther. All rights reserved.
//


#import "NSString+Path.h"

@implementation NSString (Path)

#pragma mark -
#pragma mark - 给当前文件追加文档路径
- (NSString *)ss_appendDocumentDir {
    NSString *dir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject;
    
    return [dir stringByAppendingPathComponent:self.lastPathComponent];
}

#pragma mark -
#pragma mark - 给当前文件追加缓存路径
- (NSString *)ss_appendCacheDir {
    NSString *dir = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject;
    
    return [dir stringByAppendingPathComponent:self.lastPathComponent];
}

#pragma mark -
#pragma mark - 给当前文件追加临时路径
- (NSString *)ss_appendTempDir {
    NSString *dir = NSTemporaryDirectory();
    
    return [dir stringByAppendingPathComponent:self.lastPathComponent];
}

@end
